#pragma once
#ifndef CLIB_THRD_POOL_H
#define CLIB_THRD_POOL_H

#include "clib_thrd.h"

#define CLIB_THRD_MAX   1024

#ifdef __cplusplus
extern "C" {
#endif



typedef struct clib_thrd_pool_s
{
    i32_t       thrd_cnt;
    i32_t       thrd_alive;
    clib_thrd_t thrd[CLIB_THRD_MAX];
} clib_thrd_pool_t;

clib_thrd_pool_t*
clib_thrd_pool_create();

i32_t
clib_thrd_set_work_core(i32_t idx, i32_t cpu);

i32_t
clib_thrd_set_main_core(i32_t idx, i32_t cpu);

i32_t
clib_thrd_pool_init(clib_thrd_pool_t* pool, i32_t cnt);

i32_t
clib_thrd_pool_join(clib_thrd_pool_t* pool);


#ifdef __cplusplus
}
#endif

#endif